//
//  TableHeader.m
//  Swipes
//
//  Created by Wii on 15/12/9.
//  Copyright © 2015年 Wii. All rights reserved.
//

#import "WiiTableHeader.h"
@implementation WiiTableHeader

- (instancetype)initWithFrame:(CGRect)frame dataSource:(NSArray *)dataSource{
    self = [super initWithFrame:frame];
    if (self) {
        self.dataSource = dataSource;
        UIView *headView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 30)];
        headView.backgroundColor = [UIColor clearColor];
        UILabel *count = [[UILabel alloc]initWithFrame:CGRectMake(SCREEN_WIDTH - 100, 0, 100, 21)];
        count.text = [NSString stringWithFormat:@"%lu Task",(unsigned long)self.dataSource.count];
        count.textAlignment = NSTextAlignmentCenter;
        count.font = [UIFont systemFontOfSize:14];
        [count setTextColor:[UIColor blackColor]];
        [headView addSubview:count];
        [self addSubview:headView];
    }
    return self;
}

@end
